package cn.com.taiji.oospub.wechat.entity;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.web.bind.annotation.RequestMethod;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author 
 * @since 2020-10-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_acl_resource")
public class AclResource implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableField("ID")
    private String id;

    @TableField("LIST")
    private Double list;

    @TableField("LOGO_PIC")
    private String logoPic;

    @TableField("MENU_ID")
    private String menuId;

    @TableField("MENU_TYPE")
    private MenuType menuType;

    @TableField("NAME")
    private String name;

    @TableField("NAME_EN")
    private String nameEn;

    @TableField("TYPE_CODE")
    private String typeCode;

    @TableField("URL")
    private String url;

    @TableField("REQUEST_METHOD")
    private String requestMethod;

    @TableField("RESOURCE_CATEGORY")
    private String resourceCategory;


    public enum MenuType
    {
        COLUMN("栏目菜单") {},
        BOX_TAB("标签菜单") {},
        NOT_MENU("非菜单") {},
        ;
        private String value;

        private MenuType(String value)
        {
            this.value = value;
        }

        public String getValue()
        {
            return value;
        }
    }

    public static String getRequest(String url, RequestMethod method)
    {
        return url + "_" + method.name();
    }


}
